using Traceability.API.Config;
using Traceability.API.Services;

namespace Traceability.API.Extensions
{
    /// <summary>
    /// 服务集合扩展方法
    /// </summary>
    public static class ServiceCollectionExtensions
    {
        /// <summary>
        /// 添加七牛云服务
        /// </summary>
        /// <param name="services">服务集合</param>
        /// <param name="configuration">配置</param>
        /// <returns>服务集合</returns>
        public static IServiceCollection AddQiNiuService(this IServiceCollection services, IConfiguration configuration)
        {
            // 配置七牛云选项
            services.Configure<QiNiuOptions>(configuration.GetSection("QiNiu"));
            
            // 注册七牛云服务
            services.AddScoped<IQiNiuService, QiNiuService>();
            
            return services;
        }
    }
}
